#ifndef _WMI_HRESULT_H
#define _WMI_HRESULT_H

/******************************************************************************
** @file	wmi_hresult.h
** @author  Joel Chuca Condo
**
** @date	Agu 9, 2010
**
** @desc	This class represents the result of a operation. 
**			
**
******************************************************************************/

#include <string>
#include <WinError.h>

using namespace std;

class WMI_HResult
{
public:
    /**
    * Default constructor
    */
    WMI_HResult();

    /**
    * WMI_HResult constructor that initializes the atributes according
    * to the parameters.
    *
    * @param name. Name for this WMI_HResult instance.
    * @param description. A short text that describes to the '_name' attribute
    * @param value. HRESULT value
    */
    WMI_HResult(const wstring& name, const wstring& description, HRESULT value);

    /**
    * WMI_HResult constructor that initializes the atributes according
    * to the parameters.
    *
    * @param name. Name for this WMI_HResult instance.
    * @param description. A short text that describes to the '_name' attribute
    * @param value. HRESULT value
    */
    WMI_HResult(const wstring& description, HRESULT value);

    /**
    * WMI_HResult constructor that initializes the atributes according
    * to a other instance.
    *
    * @param whr. other WMI_HResult instance.
    */
    WMI_HResult(const WMI_HResult& whr);

    /**
    * Gets a text that contains the attributes' values in string
    * 
    * @return a text of string type 
    */
    string toString();

    /**
    * Gets a text that contains the attributes' values in wstring
    *
    * @return a text of wstring type 
    */
    wstring toWString();

    /**
    * Gets the '_name' attribute
    */
    const wstring& 
    getName()
    {
        return _name;
    }

    /**
    * Sets the '_name' attribute
    */
    void 
    setName(const wstring& name)
    {
        _name = name;
    }

    /**
    * Gets the '_description' attribute
    */
    const wstring&
    getDescription()
    {
        return _description;
    }

    /**
    * Sets the '_description' attribute
    */
    void 
    setDescription(const wstring& description)
    {
        _description = description;
    }

    /**
    * Gets the '_hr' attribute
    */
    HRESULT
    getHRESULT()
    {
        return _hr;
    }

    /**
    * Sets the '_fr' attribute
    */
    void 
    setHRESULT(HRESULT hr)
    {
        _hr = hr;
    }


private:
    /**
    * Holds a name to identify a WMI_HResult instance.
    */
    wstring _name;

    /**
    * Holds a short text that describes the '_name' attribute.
    */
    wstring _description;
    
    /**
    * Holds a value of HRESULT type
    */
    HRESULT _hr;    
};

#endif